package ferran.alcazar.one;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;

public class principal extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.principal);

	}

	public void empezar() {
		Intent intent = new Intent(principal.this, And_pipatijActivity.class);
		principal.this.startActivity(intent);
	}

	public void start(View V) {
		empezar();
	}

	public void language() {
		Intent intent = new Intent(principal.this, idiomas.class);
		principal.this.startActivity(intent);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.menu, menu);
		return true;
	}

	// option menu
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle item selection
		switch (item.getItemId()) {
		case R.id.new_game:
			empezar();
			return true;
		case R.id.language:
			language();
			return true;
		default:
			return super.onOptionsItemSelected(item);
		}
	}
}